<div class="theme-form">
    <fieldset>
        <a href="<?= SITE_URL ?>profesor/adaugare_tema" class="link_util">Adaugare Tema</a>
        <? if( count( $teme ) > 0 ) { ?>
            <table class="vezi_teme">
                <?php echo $this->Html->tableHeaders( array( "Nume", "Student", "Data ultimei modificari", "Optiuni" ) ); ?>
                <?php foreach( $teme as $tema ) { ?>
                    <tr>

                        <td><?php echo $tema['Theme']['name']; ?></td>
                        <td><?php echo ( $tema['Theme']['id_stud'] == 0 ) ? "Asteptare Confirmare" : $tema['Stud']['nume'] . " " . $tema['Stud']['prenume']; ?></td>
                        <td><?php echo $tema['Theme']['modified']; ?></td>
                        <td>
                            <a href="stergere_tema?id=<?php echo $tema['Theme']['id'] ?>">Sterge</a>
                            <a href="editare_tema/<?php echo $tema['Theme']['id'] ?>">Editare</a>

                            <?php
                                if( $tema['Theme']['id_stud'] != 0 ) {
                                    echo $this->Html->link( "Vezi Progress", array(
                                        "action" => "vizualizare_tema",
                                        $tema['Theme']['id']
                                    ) );
                                }
                                else {
                                    echo $this->Html->link( "Studenti inscrisi", array(
                                        "controller" => "registration",
                                        "action"     => "get_registrations",
                                        $tema['Theme']['id']
                                    ) );
                                }
                            ?>
                        </td>
                    </tr>
                <?php } ?>
            </table>
        <?
        }
        else {
            echo "<div style='float: left; width: 100%'>Nu aveti adaugata nicio tema!</div>";
        }?>
    </fieldset>
</div>
<?php echo $this->Paginator->numbers(); ?>
